﻿function openPopupManagerMonitoring(dateTracking, by_sup, by_manager) {
    //var by_manager = document.getElementById("ctl00_ContentPlaceHolder1_UCAttendanaceTracking1_hdBy_manager").value;
    //var by_sup = document.getElementById("ctl00_ContentPlaceHolder1_UCAttendanaceTracking1_hdBy_sup").value;
    //var dateTracking = document.getElementById("ctl00_ContentPlaceHolder1_UCAttendanaceTracking1_hdDate_tracking").value;
    window.open("~/../Popup/ManagerActionList.aspx?by_manager=" + by_manager + "&by_sup=" + by_sup + "&dateTracking=" + dateTracking, "View", "menubar=no,width=600,height=400,toolbar=no");
}

function openPopupSupMonitoring(by_na, by_shift, by_shop, byDatetime, byTime_point) {
    window.open("~/../Popup/SupAction.aspx?by_na=" + by_na + "&by_shift=" + by_shift + "&by_shop=" + by_shop + "&byDatetime=" + byDatetime + "&byTime_point=" + byTime_point, "View", "menubar=no,width=600,height=400,toolbar=no");
}

function openPopupViewReport(report) {
    //Bao cao thong tin khach hang
    if (report == "viewShopper") {
        var fromDate = document.getElementById("ctl00_ContentPlaceHolder1_dtFromDate_I").value;
        var toDate = document.getElementById("ctl00_ContentPlaceHolder1_dtTodate_I").value;
        window.open("~/../ViewReport.aspx?fromDate=" + fromDate + "&toDate=" + toDate + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    }

    //Bao cao doanh so NA
    if (report == "viewNaSale") {
        var by_na = document.getElementById("ctl00_ContentPlaceHolder1_cboNA").value;
		if (by_na == "")
			return;
        var fromDate = document.getElementById("ctl00_ContentPlaceHolder1_dtFromDate_I").value;
        var toDate = document.getElementById("ctl00_ContentPlaceHolder1_dtToDate_I").value;
        window.open("~/../ViewReport.aspx?na=" + by_na + "&fromDate=" + fromDate + "&toDate=" + toDate + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    };

    //Bao cao doanh so Sup
    if (report == "viewSupSale") {
        var by_sup = document.getElementById("ctl00_ContentPlaceHolder1_cboSup").value;
        if (by_sup == "")
            return;
        var fromDate = document.getElementById("ctl00_ContentPlaceHolder1_dtFromDate_I").value;
        var toDate = document.getElementById("ctl00_ContentPlaceHolder1_dtToDate_I").value;
        window.open("~/../ViewReport.aspx?sup=" + by_sup + "&fromDate=" + fromDate + "&toDate=" + toDate + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    };

    //Bao cao doanh so Shop
    if (report == "viewShopSale") {
        var fromDate = document.getElementById("ctl00_ContentPlaceHolder1_dtFromDate_I").value;
        var toDate = document.getElementById("ctl00_ContentPlaceHolder1_dtToDate_I").value;
        window.open("~/../ViewReport.aspx?fromDate=" + fromDate + "&toDate=" + toDate + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    }

    //Bao cao nhap kho cua cua hang
    if (report == "viewWareHousing") {
        var fromDate = document.getElementById("ctl00_ContentPlaceHolder1_dtFromDate_I").value;
        var toDate = document.getElementById("ctl00_ContentPlaceHolder1_dtToDate_I").value;
        window.open("~/../ViewReport.aspx?fromDate=" + fromDate + "&toDate=" + toDate + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    }

    //Bao cao san pham ton kho cua cua hang
    if(report == "viewProductInShop"){
        var date = document.getElementById("ctl00_ContentPlaceHolder1_dtDate_I").value;
        window.open("~/../ViewReport.aspx?date=" + date + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    }

    //Bao cao gia ban le cua cua hang
    if (report == "viewPriceAudit") {
        var date = document.getElementById("ctl00_ContentPlaceHolder1_dtDate_I").value;
        window.open("~/../ViewReport.aspx?date=" + date + "&report=" + report, "ViewReport", "width=600,height=400, toolbar=no,scrollbars=yes,menubar=no,resizable=yes,status=no,dependent=yes");
    }
}






